#include<stdio.h>
#include"global.h"
menu(){
	char key;
//	printf("\nS  :Show\nA  :Add\nM  :Modify\nF  :Find\nE  :End\n");
//	scanf("%c",&key);
	key='O';
	while(key){
		printf("\nS  :Show\nA  :Add\nM  :Modify\nF  :Find\nD  :Delete\nK  :Keep\nR  :Recover\nE  :End\n");
		scanf("%c",&key);getchar();
		switch(key){
		case 'S':show();
			break;
		case 'A':add();
			break;
		case 'M':modify();
			break;
		case 'F':find();
			break;
		case 'D':del();
			break;
		case 'K':filewriteauto(head);
			filewritefor(head);
			break;
		case 'R':head=fileread(key);
			break;
		case 'E':return(0);
		default:printf("\nNo such selection\n");
		}
	}
}
void main(){
	char key='A';
	head=fileread(key);
	menu();
}